<?php
/**
 * Created by PhpStorm.
 * User: zhang
 * Date: 2018/1/24
 * Time: 11:49
 */

$raw = '22.11.2018';
$dateTime = DateTime::createFromFormat('d.m.Y', $raw);
echo $dateTime->format('Y-m-d').PHP_EOL;

$end = clone $dateTime;
$end->add(new DateInterval('P1M6D'));

$diff = $end->diff($dateTime);
echo 'Difference: ' . $diff->format('%m month, %d days (total: %a days)') . "\n";
// Difference: 1 month, 6 days (total: 37 days)